﻿Public Class Costos



    Private Sub Costos_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Combotramite.Items.Add("Inscripción inicial")
        Combotramite.Items.Add("Transferencia")

        Combomarca.Items.Add("3-STAR")
        Combomarca.Items.Add("AGRALE")
        Combomarca.Items.Add("ALFA ROMEO")
        Combomarca.Items.Add("APPIA")
        Combomarca.Items.Add("ARO")
        Combomarca.Items.Add("ASIA")
        Combomarca.Items.Add("AUDI")
        Combomarca.Items.Add("BAJAJ")
        Combomarca.Items.Add("BELAVTOMAZ")
        Combomarca.Items.Add("BETA")
        Combomarca.Items.Add("BETAMOTOR")
        Combomarca.Items.Add("BLAC")
        Combomarca.Items.Add("BLACKSTONE")
        Combomarca.Items.Add("BMW")
        Combomarca.Items.Add("BRAVA")
        Combomarca.Items.Add("CERRO")
        Combomarca.Items.Add("CHERY")
        Combomarca.Items.Add("CHEVROLET")
        Combomarca.Items.Add("CHRYSLER")
        Combomarca.Items.Add("CITROEN")
        Combomarca.Items.Add("CORVEN")
        Combomarca.Items.Add("DA DALT")
        Combomarca.Items.Add("DACIA")
        Combomarca.Items.Add("DAEWOO")
        Combomarca.Items.Add("DAIHATSU")
        Combomarca.Items.Add("DEUTZ")
        Combomarca.Items.Add("DEUTZ AGRALE")
        Combomarca.Items.Add("DIMEZ")
        Combomarca.Items.Add("DODGE")
        Combomarca.Items.Add("DUCATI")
        Combomarca.Items.Add("FERESA")
        Combomarca.Items.Add("FERRARI")
        Combomarca.Items.Add("FIAT")
        Combomarca.Items.Add("FIAT IVECO")
        Combomarca.Items.Add("FORD")
        Combomarca.Items.Add("GALLOPER")
        Combomarca.Items.Add("GAMMA")
        Combomarca.Items.Add("GARELLI SAHEL")
        Combomarca.Items.Add("GAZ")
        Combomarca.Items.Add("GENERAL MOTORS")
        Combomarca.Items.Add("GILERA")
        Combomarca.Items.Add("GMC")
        Combomarca.Items.Add("GUERRERO")
        Combomarca.Items.Add("HARLEY DAVIDSON")
        Combomarca.Items.Add("HEI BAO")
        Combomarca.Items.Add("HONDA")
        Combomarca.Items.Add("HTUNDAI")
        Combomarca.Items.Add("IES")
        Combomarca.Items.Add("IMSA")
        Combomarca.Items.Add("INFINITI")
        Combomarca.Items.Add("INNOCENTI")
        Combomarca.Items.Add("INTERNACIONAL")
        Combomarca.Items.Add("ISUZU")
        Combomarca.Items.Add("IVECO")
        Combomarca.Items.Add("JAC")
        Combomarca.Items.Add("JAGUAR")
        Combomarca.Items.Add("JEEP")
        Combomarca.Items.Add("JIANSHE")
        Combomarca.Items.Add("JINCHENG")
        Combomarca.Items.Add("JMSTAR")
        Combomarca.Items.Add("KAWASAKI")
        Combomarca.Items.Add("KELLER")
        Combomarca.Items.Add("KIA")
        Combomarca.Items.Add("KIKAI")
        Combomarca.Items.Add("KONISA")
        Combomarca.Items.Add("KTM")
        Combomarca.Items.Add("KYMCO")
        Combomarca.Items.Add("LADA")
        Combomarca.Items.Add("LANCER")
        Combomarca.Items.Add("LAND ROVER")
        Combomarca.Items.Add("LEXUS")
        Combomarca.Items.Add("MACK")
        Combomarca.Items.Add("MARCOPOLO")
        Combomarca.Items.Add("MARUTI")
        Combomarca.Items.Add("MARUTI SUZUKI")
        Combomarca.Items.Add("MASERATI")
        Combomarca.Items.Add("MAVERICK")
        Combomarca.Items.Add("MAVERICK MOTORCYCLES")
        Combomarca.Items.Add("MAZDA")
        Combomarca.Items.Add("MERCEDES BENZ")
        Combomarca.Items.Add("MERCEDES BENZ/MARCOP")
        Combomarca.Items.Add("METRO")
        Combomarca.Items.Add("MG")
        Combomarca.Items.Add("MINI")
        Combomarca.Items.Add("MITSUBISHI")
        Combomarca.Items.Add("MONDIAL")
        Combomarca.Items.Add("MOTOMEL")
        Combomarca.Items.Add("NAKAI")
        Combomarca.Items.Add("NISSAN")
        Combomarca.Items.Add("OKINOI")
        Combomarca.Items.Add("OPEL")
        Combomarca.Items.Add("PEUGEOT")
        Combomarca.Items.Add("PLYMOUTH")
        Combomarca.Items.Add("POLARIS")
        Combomarca.Items.Add("PORSCHE")
        Combomarca.Items.Add("PROTON")
        Combomarca.Items.Add("QINGQI")
        Combomarca.Items.Add("RANGE ROVER")
        Combomarca.Items.Add("RANQUEL")
        Combomarca.Items.Add("RENAULT")
        Combomarca.Items.Add("ROVER")
        Combomarca.Items.Add("ROYAL ENFIELD")
        Combomarca.Items.Add("SAAB")
        Combomarca.Items.Add("SAAB SCANIA")
        Combomarca.Items.Add("SANTANA")
        Combomarca.Items.Add("SANXING")
        Combomarca.Items.Add("SCANIA")
        Combomarca.Items.Add("SCANIA/MARCOPOLO")
        Combomarca.Items.Add("SEAT")
        Combomarca.Items.Add("SMART")
        Combomarca.Items.Add("SPACE")
        Combomarca.Items.Add("SSANGYONG")
        Combomarca.Items.Add("SUBARU")
        Combomarca.Items.Add("SUMO")
        Combomarca.Items.Add("SUZUKI")
        Combomarca.Items.Add("SUZUKI - SANTANA")
        Combomarca.Items.Add("TATA")
        Combomarca.Items.Add("TIBO")
        Combomarca.Items.Add("TOYOTA")
        Combomarca.Items.Add("VOLKSWAGEN")
        Combomarca.Items.Add("VOLVO")
        Combomarca.Items.Add("WULING")
        Combomarca.Items.Add("YUEJIN")
        Combomarca.Items.Add("ZANELLA")


    End Sub

    Private Sub Combomarca_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Combomarca.SelectedIndexChanged

        Dim ocostosNegocio As New Negocios.Ncostos
        Dim omodelo As New Entidades.Ecostos

        Combomodelo.DataSource = ocostosNegocio.combocostos(Combomarca.Text)
        Combomodelo.DisplayMember = "f1"
        Combomodelo.ValueMember = "f6"
        txtmarca.Text = Combomarca.Text

    End Sub

    Private Sub Combomodelo_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Combomodelo.SelectedIndexChanged

        Dim ocostos2Negocio As New Negocios.Ncostos
        Dim otipo As New Entidades.Ecostos

        combotipovehi.DataSource = ocostos2Negocio.combocostostipo2(Combomodelo.Text)
        combotipovehi.DisplayMember = "f1"
        combotipovehi.ValueMember = "f7"

        txtmodelo.Text = Combomodelo.Text

    End Sub

    Private Sub combotipovehi_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles combotipovehi.SelectedIndexChanged
        txttipo.Text = combotipovehi.Text
    End Sub


    Private Sub Combotramite_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Combotramite.SelectedIndexChanged
        If Combotramite.Text = "Inscripción inicial" Then
            txtinscripcion.Enabled = True
            txttransferencia.Enabled = False
        End If
        If Combotramite.Text = "Transferencia" Then
            txttransferencia.Enabled = True
            txtinscripcion.Enabled = False
        End If
    End Sub


    'Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    '    Dim costos As New List(Of Entidades.Ecostos)
    '    Dim costosrod As New Negocios.Ncostos
    '    Dim costo As New Entidades.Ecostos
    '    'Dim i As Long

    '    LVcostos.Items.Clear()
    '    LVcostos.View = View.Details

    '    costo.F5 = Trim(txtmarca.Text)
    '    costo.F6 = Trim(txtmodelo.Text)
    '    costo.F7 = Trim(txttipo.Text)

    '    'LVcostos.Enabled = True

    '    costos = costosrod.buscarCosto(costo)


    '    'LVcostos.BeginUpdate()

    '    'If LVcostos.Items.Count > 0 Then LVcostos.Items.Clear()

    '    'For Each ocostorodado As Entidades.Ecostos In costos

    '    '    Dim oitem As ListViewItem

    '    '    oitem = LVcostos.Items.Add(ocostorodado.F8R)
    '    '    oitem.SubItems.Add(ocostorodado.F8R)
    '    '    oitem.SubItems.Add(ocostorodado.F9R)
    '    '    oitem.SubItems.Add(ocostorodado.F10R)
    '    '    oitem.SubItems.Add(ocostorodado.F11R)
    '    '    oitem.SubItems.Add(ocostorodado.F12R)
    '    '    oitem.SubItems.Add(ocostorodado.F13R)
    '    '    oitem.SubItems.Add(ocostorodado.F14R)
    '    '    oitem.SubItems.Add(ocostorodado.F15R)
    '    '    oitem.SubItems.Add(ocostorodado.F16R)
    '    '    oitem.SubItems.Add(ocostorodado.F17R)
    '    '    oitem.SubItems.Add(ocostorodado.F18R)
    '    '    oitem.SubItems.Add(ocostorodado.F19R)
    '    '    oitem.SubItems.Add(ocostorodado.F20R)
    '    '    oitem.SubItems.Add(ocostorodado.F21R)
    '    '    oitem.SubItems.Add(ocostorodado.F22R)
    '    '    oitem.SubItems.Add(ocostorodado.F23R)
    '    '    oitem.SubItems.Add(ocostorodado.F24R)
    '    '    oitem.SubItems.Add(ocostorodado.F25R)
    '    '    oitem.SubItems.Add(ocostorodado.F26R)
    '    '    oitem.SubItems.Add(ocostorodado.F27R)
    '    '    oitem.SubItems.Add(ocostorodado.F28R)
    '    '    oitem.SubItems.Add(ocostorodado.F29R)
    '    '    oitem.SubItems.Add(ocostorodado.F30R)
    '    '    oitem.SubItems.Add(ocostorodado.F31R)
    '    '    oitem.SubItems.Add(ocostorodado.F32R)

    '    'Next

    '    'LVcostos.EndUpdate()
    '    dgcosto.DataSource = costo.F9R
    '    dgcosto.DataSource = costo.F10R
    '    dgcosto.DataSource = costo.F11R
    '    dgcosto.DataSource = costo.F12R
    '    dgcosto.DataSource = costo.F13R
    '    dgcosto.DataSource = costo.F14R
    '    dgcosto.DataSource = costo.F15R
    '    dgcosto.DataSource = costo.F16R
    '    dgcosto.DataSource = costo.F17R
    '    dgcosto.DataSource = costo.F18R
    '    dgcosto.DataSource = costo.F19R
    '    dgcosto.DataSource = costo.F20R
    '    dgcosto.DataSource = costo.F21R
    '    dgcosto.DataSource = costo.F22R
    '    dgcosto.DataSource = costo.F23R
    '    dgcosto.DataSource = costo.F24R
    '    dgcosto.DataSource = costo.F25R



    'End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim costos As New List(Of Entidades.Ecostos)
        Dim costosrod As New Negocios.Ncostos
        Dim costo As New Entidades.Ecostos
        LVcostos.Items.Clear()
        LVcostos.View = View.Details

        costo.F1 = txtnacimp.Text
        costo.F6 = txtmodelo.Text


        LVcostos.Enabled = True
        costos = costosrod.buscarCosto(costo)


        LVcostos.BeginUpdate()
        If LVcostos.Items.Count > 0 Then LVcostos.Items.Clear()
        For Each opersona As Entidades.Ecostos In costos
            Dim oitem As ListViewItem
            oitem = LVcostos.Items.Add(costo.F8)
            oitem.SubItems.Add(costo.F9)
            oitem.SubItems.Add(costo.F10)
            oitem.SubItems.Add(costo.F11)
            oitem.SubItems.Add(costo.F12)
            oitem.SubItems.Add(costo.F13)
            oitem.SubItems.Add(costo.F14)
            oitem.SubItems.Add(costo.F15)
            oitem.SubItems.Add(costo.F16)
            oitem.SubItems.Add(costo.F17)
            oitem.SubItems.Add(costo.F18)
            oitem.SubItems.Add(costo.F19)
            oitem.SubItems.Add(costo.F20)
            oitem.SubItems.Add(costo.F21)
            oitem.SubItems.Add(costo.F22)
            oitem.SubItems.Add(costo.F23)
            oitem.SubItems.Add(costo.F24)
            oitem.SubItems.Add(costo.F25)
            oitem.SubItems.Add(costo.F26)
            oitem.SubItems.Add(costo.F27)
            oitem.SubItems.Add(costo.F28)
            oitem.SubItems.Add(costo.F29)
            oitem.SubItems.Add(costo.F30)
            oitem.SubItems.Add(costo.F31)
            oitem.SubItems.Add(costo.F32)
        Next
        LVcostos.EndUpdate()

    End Sub

End Class